﻿#include "EditorPageViewModel.h"



void REditorPageViewModel::BindModel(TSharedObjectPtr<REditorPageModel> InModel)
{
    BaseModel = InModel;
    InModel->ViewModel = this;
}

TSharedObjectPtr<REditorPageModel> REditorPageViewModel::GetModel() const
{
    return BaseModel;
}

bool REditorPageViewModel::HasUnsavedData() const
{
    return BaseModel->HasUnsavedData();
}

void REditorPageViewModel::SaveFile() const
{
    BaseModel->Save();
}

bool REditorPageViewModel::Undo()
{
    if(BaseModel->Undo())
    {
        PostUndo();
        return true;
    }
    return false;
}

bool REditorPageViewModel::CanUndo()
{
    return BaseModel->CanUndo();
}

bool REditorPageViewModel::Redo()
{
    if(BaseModel->Redo())
    {
        PostRedo();
        return true;
    }
    return false;
}

bool REditorPageViewModel::CanRedo()
{
    return BaseModel->CanRedo();
}

bool REditorPageViewModel::Cut()
{
    return false;
}

bool REditorPageViewModel::Copy()
{
    return false;
}

bool REditorPageViewModel::Paste()
{
    return false;
}

bool REditorPageViewModel::CanCut() const
{
    return false;
}

bool REditorPageViewModel::CanCopy() const
{
    return false;
}

bool REditorPageViewModel::CanPaste() const
{
    return false;
}
